package com.rd.student.jike.class2.lihongming.Solution713;

import java.util.Scanner;

/**
 * @Auther:Heinrich
 * @Date:2023/7/13-07-13-9:53
 * @Description:com.rd.student.jike.class2.lihongming.Solution713
 * @version:1.0
 */
public class Question1 {
    public static void printTower(int floors) {
        for (int i = 1; i <= floors; i++) {
            for (int j = 0; j < floors-i; j++) {
                System.out.print(" ");
            }
            for (int j = 0; j < i; j++) {
                System.out.print("*");
            }
            for (int j = 0; j < i-1; j++) {
                System.out.print("*");
            }
//            for (int j = 0; j < floors-i; j++) {
//                System.out.print(" ");
//            }
            System.out.println();
        }

    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入金字塔的层数");
        Question1.printTower(scanner.nextInt());
    }
}
